package org.web.accesscontrollist.server.controller;

import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.annotation.Resource;
import java.util.Map;
import java.util.HashMap;
import com.google.gson.Gson;
//import org.web.accesscontrollist.server.config.Config1;
@Controller
@RequestMapping("/")
public class HelloWorldController {

    private static final Logger logger = LogManager.getLogger(HelloWorldController.class);

    @RequestMapping("helloWorld")
    @ResponseBody
    public String sayHelloWorld(String name) {
        logger.info("name is : " + name);
        System.out.println("hello " + name);
        return "welcome to world, " + name;
    }


//    @Resource
//    private Config1 config1;
//
//    @RequestMapping("getConfigInfo")
//    @ResponseBody
//    public String getConfigInfo() {
//       Gson gson = new Gson();
//       Map map = new HashMap();
//       map.put("a1", config1.getA1());
//       map.put("a2", config1.getA2());
//       map.put("a3", config1.getA3());
//       map.put("UserConfig", config1.getUserConfig());
//       return gson.toJson(map);
//     }
}
